<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="menu" content="superviseMenu" />
<meta name="nav" content="2" />
<meta name="acc" content="0" />
<title>中间交工验收申请</title>
<%@ include file="/common/extjs.jsp"%>
<script type="text/javascript">
	$(document).ready(
			function() {
				$("#dep1").hide();
				$("#dep2").hide();
				$("#inputForm").validate({
					event : "blur",
					isTip : true
				});

				var date = new Date();
				$.get(
						"${ctx}/business/history/history!info.action?key=${id}&time="
								+ date, function(data) {
							$("#frame").html(data);
						});
				$("#name").click(function() {
					UserNameSelector.getView(function(a, c) {
						$("#name").val(c);
						$("#deptnames").val(a);
						if (a != "") {
							var count = a.split(",").length;
							$("#value").val(count);
						}
					}).show();
				});
				$("#usern").click(function() {
					UserSelector.getView(function(a, c) {
						$("#usern").val(c);
						$("#userid").val(a);
					}, true).show();
				});
			});
	function change() {
		var outcome = $("#outcome").val();
		if (outcome == "部门会签") {
			$("#dep1").show();
			$("#dep2").show();
			$("#key").attr("disabled", false);
			$("#deptnames").attr("disabled", false);
			$("#name").attr("class","required choose");
			$("#value").attr("class","required");
		} else {
			$("#dep1").hide();
			$("#dep2").hide();
			$("#led").show();
			$("#key").attr("disabled", true);
			$("#deptnames").attr("disabled", true);
			$("#name").attr("class","");
			$("#value").attr("class","");
		}
	}
	function close() {
		$.window.closeAll();
	}
</script>
</head>
<body>
	<form action="${ctx}/business/middledetect!submit.action" method="post"
		id="inputForm" class="yform">
		<input type="hidden" id="id" name="id" value="${id }"> <input
			type="hidden" name="status" id="status" value="08"> <input
			type="hidden" name="projectId" id="projectId" value="${projectId}">
		<input type="hidden" name="taskId" id="taskId"
			value="${(empty taskid)?taskId : taskid}"> <input
			type="hidden" id="taskid" name="taskid"
			value="${(empty taskid)?taskId : taskid}"> <input
			type="hidden" name="fid" id="fid" value="${id}"> <input
			type="hidden" name="key" id="key" value="count"> <input
			type="hidden" name="key1" id="key1" value="leader">
		<div id="caption">
			<h6>审核记录</h6>
		</div>
		<div id="frame"></div>
		<div id="caption">
			<h6>部门负责人审核意见</h6>
		</div>
		<div>
			<table class="noborder">
				<tr class="type-text">
					<td>是否需要部门会签</td>
					<td><select name="outcome" style="width: 70px"
						onchange="change();" id="outcome">
							<option value="分管领导签发">否</option>
							<option value="部门会签">是</option>
					</select></td>
				</tr>
				<tr class="type-text" id="dep1">
					<td>部门会签人</td>
					<td colspan="3"><input type="text" name="name" value=""
						id="name" readonly="readonly" /> <input
						type="hidden" name="deptnames" id="deptnames" /></td>
				</tr>
				<tr class="type-text" id="dep2">
					<td>部门会签人数</td>
					<td colspan="3"><input type="text" name="value" value=""
						id="value" readonly="readonly"/></td>
				</tr>
				<tr id="led">
					<td width="80">分管领导审核人</td>
					<td><pt:labels type="user" argument1="领导组" name="value1"
							hasEmpty="false"></pt:labels></td>
				</tr>
				<tr class="type-text">
					<td width="80">审核意见</td>
					<td><textarea name="view" id="view" rows="3"></textarea></td>
				</tr>
			</table>
		</div>
		<div class="type-button">
			<input type="submit" class="submit" value="提交"
				onclick="return isProcess();" /> 
			<a
				href="javascript:showWindow('查看申请资料','${ctx}/business/mdetect/petition!input.action?fid=${id}&projectId=${projectId}&decorator=open&confirm=true')">查看申请资料</a>
		</div>
	</form>
</body>
</html>